/**
 * Resourece
 * @ 男孩
 */
import { Base } from "@/pixi/base";
class Resourece extends Base {
  Resourece: any[];
  getSprites: any;
  position: object | string;
  anchor: object | string;
  constructor() {
    super();
    this.Resourece = [];
    this.getSprites = {};
    this.load();
    this.position = "center";
    this.anchor = "center";
  }
  load() {
    // 遍历资源
    for (let i = 1; i <= 34; i++) {
      this.Resourece.push({
        name: `body${i}`,
        url: require(`@/${this.baseUrl}/images/w${i}.png`),
      });
    }
    // 设置精灵 默认
    console.log(this.Resourece)
    const Resourece = JSON.parse(JSON.stringify(this.Resourece))
    for (let i = 0; i <= Resourece.length - 1; i++) {
      this.getSprites[Resourece[i].name] = {
        key: `${Resourece[i].name}`,
        size: { mode: "widthFit", width: 3.8 },
        position: {
          x: 1.7,
          y: 1,
        },
        anchor: "bottom",
        alpha: '1',
      };
    }
  }
}
export default new Resourece();
